<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>示例8</title>
</head>
<body>
    <script>
        function Person(){
            this.foot = 2;
        }

        Person.prototype.getFoot = function (){
            return this.foot;
        }

        function Woman(){
            this.head = 1;
        }

        Woman.prototype = new Person();
        Woman.prototype.getHead = function (){
            return this.head;
        }

        //重写父类型的方法
        Woman.prototype.getFoot = function (){
            return false;
        }

        const woman = new Woman();
        console.log(woman.getHead(),woman.getFoot())

    </script>
</body>
</html>